package com.atguigu.yygh.enums;



public enum StatusEnum {
    NORMAL(1,"正常"),
    LOCK(0,"锁定");
    ;
    private Integer status;
    private String name;

    public static String getNameByStatus(Integer status){
        StatusEnum[] values = StatusEnum.values();
        for (StatusEnum statusEnum : values) {
            if(status.intValue() == statusEnum.getStatus().intValue()){
                return statusEnum.getName();
            }
        }
        return "";
    }

    StatusEnum(Integer status, String name) {
        this.status = status;
        this.name = name;
    }

    public Integer getStatus() {
        return status;
    }

    public String getName() {
        return name;
    }
}
